{extend name="layout"/}

{block name="breadcrumb"}
<h2>用户列表</h2>
<ol class="breadcrumb">
    <li><a href="{:url('index/index')}">首页</a></li>
    <li><strong>用户列表</strong></li>
</ol>
{/block}

{block name="search"}
{include file='oauth/search'/}
{/block}

{block name="main"}
<div class="ibox float-e-margins">
    <div class="ibox-title">
        <h5>用户列表</h5>
    </div>
    <div class="ibox-content">
        <p>
            <button class="btn btn-danger btn-sm" onclick="actionAll('{:url("disables", ['status' => 0])}')">批量禁用</button>
            <button class="btn btn-primary btn-sm" onclick="actionAll('{:url("disables", ['status' => 1])}')">批量启用</button>
        </p>
        <div class="table-responsive table-elem">
            <p>共 {$count} 条数据</p>
            <table class="table table-striped">
                <thead>
                <tr>
                    <th class="checkbox-th">
                        <div class="checkbox checkbox-primary">
                            <input id="checkbox-all" type="checkbox">
                            <label for="checkbox-all"></label>
                        </div>
                    </th>
                    <th>ID</th>
                    <th>昵称</th>
                    <th>课程数量</th>
                    <th>备注</th>
                    <th>地区</th>
                    <th>性别</th>
                    <th>手机号码</th>
                    <th>绑定设备</th>
                    <th>积分总额</th>
                    <th>积分余额</th>
                    <th>状态</th>
                    <th>创建时间</th>
                    <th>离线时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {foreach $model as $key=>$vo }
                <tr>
                    <td>
                        <div class="checkbox checkbox-primary">
                            <input id="checkbox{$vo.id}" type="checkbox" value="{$vo.id}" class="checkbox-item">
                            <label for="checkbox{$vo.id}"></label>
                        </div>
                    </td>
                    <td>{$vo.id}</td>
                    <td>{$vo.nickname}</td>
                    <td style="color: red">{$vo.class_num}</td>
                    <td style="color: red">{$vo.note}</td>
                    <td>{$vo.country}-{$vo.province}-{$vo.city}</td>
                    <td>{$vo.sex}</td>
                    <td>{$vo.phone}</td>
                    <td>{$vo.device_info}</td>
                    <td>{$vo.sum}</td>
                    <td>{$vo.integral}</td>
                    <td>
                        <span class="label {$vo.status == 1 ? 'label-info' : 'label-danger'}">{$vo.statusText}</span>
                    </td>
                    <td>{$vo.create_time}</td>
                    <td>{$vo.update_time}</td>
                    <td>

                        <a href="javascript:void(0);"  class="{$vo.communication == 1 ? 'updateSet btn btn-success btn-xs' : 'updateSet-one btn btn-warning btn-xs'}" data-id="{$vo.id}"> {$vo.communication == 1 ? '已沟通' : '未沟通'}</a>

                        <a href="javascript:void(0);"  class="updateNote-one btn btn-success btn-xs" data-id="{$vo.id}">备注</a>
                        <a href="{:url('detail', ['id' => $vo.id])}" class="btn btn-success btn-xs">详情</a>
                        <a href="javascript:void(0);" data-id="{$vo.id}" class="disabled-one btn btn-warning btn-xs">{$vo.status == 1 ? '禁用' : '启用'}</a>
                        <a href="{:url('oauth_order/mine', ['oauth_id' => $vo.id])}" class="btn btn-info btn-xs">我的课程</a>
                        <a href="{:url('tie_ba/mine', ['oauth_id' => $vo.id])}" class="btn btn-info btn-xs">我的帖子</a>
                        <a href="{:url('tie_ba_collect/index', ['oauth_id' => $vo.id])}" class="btn btn-info btn-xs">收藏贴子</a>
                        <a href="{:url('oauth_focus/index', ['oauth_id' => $vo.id])}" class="btn btn-info btn-xs">我的关注</a>
                        <a href="{:url('oauth_order/share', ['share_uid' => $vo.id])}" class="btn btn-info btn-xs">我的分享</a>
                        <a href="{:url('oauth_integral/index', ['oauth_id' => $vo.id])}" class="btn btn-info btn-xs">积分记录</a>
                        <a href="{:url('coupon/mine', ['oauth_id' => $vo.id])}" class="btn btn-info btn-xs">我的优惠券</a>
                    </td>
                </tr>
                {/foreach}
                </tbody>
            </table>
            {$model|raw}
        </div>

    </div>
</div>
{/block}

<!-- 加载其他js -->
{block name="jsFile"}
{load href="/static/css/plugins/datetimepicker/bootstrap-datetimepicker.min.css" /}
{load href="/static/js/plugins/datetimepicker/bootstrap-datetimepicker.min.js" /}
<script>
    $('.start-time').datetimepicker({
        weekStart: 1, // 一周从哪一天开始。0（星期日）到6（星期六）
        todayBtn:  1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2, // 日期时间选择器打开之后首先显示的视图 0 hour 1 day 2 month 3 year 4 decade
        forceParse: 1, // 当用户在输入框中输入了不正确的日期，选择器将会尽量解析输入的值
        showMeridian: 1
    });
    $('.end-time').datetimepicker({
        weekStart: 1, // 一周从哪一天开始。0（星期日）到6（星期六）
        todayBtn:  1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2, // 日期时间选择器打开之后首先显示的视图 0 hour 1 day 2 month 3 year 4 decade
        forceParse: 1, // 当用户在输入框中输入了不正确的日期，选择器将会尽量解析输入的值
        showMeridian: 1
    });
</script>
{/block}